import { _API_OPERATIONNAL_DOC_PAGELIST, PROJECT_BY_USERID, LOGIN_SSO, _API_OPERATIONNAL_DOC_SAVEORUPDATE, _API_UPLOAD_BIPFILEUPLOAD, _API_LOWCOST_TEMPLATEEXPORT, _API_OPERATIONNAL_INFO_IMPORT, _API_OPERATIONNAL_INFO_PAGELIST, _API_LOWCOST_PAGELIST, _API_LOWCOST_SAVEORUPDATE, _API_LOWCOST_DELETEBYIDS, _API_OPERATIONNAL_PAGELIST, _API_OPERATIONNAL_SAVEORUPDATE, _API_OPERATIONNAL_TEMPLATEEXPORT, _API_OPERATIONNAL_DELETEBYIDS, _API_OPERATIONNAL_INFO_EXPORT, _API_UPLOAD_GETFILEBYSTRING } from '@/api/global.js'
import { commonPromise } from '@/http'
export default {
    // 上传接口
    ApiUploadFetch: (data) => commonPromise({ data, url: 'https://wei.cscec5b.com.cn:9067/gateway/progress-server/api/upload', method: 'post' }), // 上传接口
    ApiUploadGetFileByStringFetch: (params) => commonPromise({ params, url: _API_UPLOAD_GETFILEBYSTRING, method: 'get' }), // 根据加密字符串获取文件url列表

    // 项目运营单据表(列表)

    ApiOperationalDocPageList: (data) => commonPromise({ data, url: _API_OPERATIONNAL_DOC_PAGELIST, method: 'post' }),
    ApiOperationalDocSaveOrUpdate: (data) => commonPromise({ data, url: _API_OPERATIONNAL_DOC_SAVEORUPDATE, method: 'post' }),

    // 项目运营信息表档案
    ApiOperationalPageList: (data) => commonPromise({ data, url: _API_OPERATIONNAL_PAGELIST, method: 'post' }),
    ApiOperationalSaveOrUpdate: (data) => commonPromise({ data, url: _API_OPERATIONNAL_SAVEORUPDATE, method: 'post' }),
    ApiOperationalTemplateExport: (params) => commonPromise({ params, url: _API_OPERATIONNAL_TEMPLATEEXPORT, method: 'get' }),
    ApiOperationalDeleteByIds: (data) => commonPromise({ data, url: _API_OPERATIONNAL_DELETEBYIDS, method: 'post' }),
    ApiOperationalInfoExport: (params) => commonPromise({ params, url: _API_OPERATIONNAL_INFO_EXPORT, method: 'get' }),
    ApiOperationalInfoPageList: (data) => commonPromise({ data, url: _API_OPERATIONNAL_INFO_PAGELIST, method: 'post' }),
    ApiOperationalInfoImport: (data) => commonPromise({ data, url: _API_OPERATIONNAL_INFO_IMPORT, method: 'post' }),

    // 低成本晾晒
    ApiLowcostPageList: (data) => commonPromise({ data, url: _API_LOWCOST_PAGELIST, method: 'post' }),
    ApiLowcostSaveOrUpdate: (data) => commonPromise({ data, url: _API_LOWCOST_SAVEORUPDATE, method: 'post' }),
    ApiLowcostDeleteByIds: (data) => commonPromise({ data, url: _API_LOWCOST_DELETEBYIDS, method: 'post' }),
    ApiLowcostTemplateExport: (params) => commonPromise({ params, url: _API_LOWCOST_TEMPLATEEXPORT, method: 'get' }),

    // 上传文件
    ApiBipFileUpload: (id, data) => commonPromise({ data, url: 'upload/bipFileUpload?businessId=' + id, method: 'post' }),
    // 登录API
    loginSsoFetch: (params) => commonPromise({ params, url: LOGIN_SSO, method: 'get' }), // 单点登录接口
    // 项目
    projectFetch: (params) => commonPromise({ params, url: PROJECT_BY_USERID, method: 'get' }),
    // 获取收费标准详情
    getChargeStdDetail: (params) => commonPromise({ params, url: `chargeStd/info/getChargeStdDetail/${params.infoId}`, method: 'get' }),
    // 保存检测项目及参数详情(全量)
    saveChargeStd: (data) => commonPromise({ data, url: 'chargeStd/item/saveChargeStdItemDetail', method: 'post' }),
    // 获取检测领域列表
    getDomainList: (params) => commonPromise({ params, url: 'dataDict/queryChargeDomainPage', method: 'get' }),
    // 获取检测标准列表
    getStdList: (params) => commonPromise({ params, url: 'dataDict/queryDetectionStdPage', method: 'get' }),


    // 合同

    // 查询合同列表(分页)
    getContractList: (params) => commonPromise({ params, url: 'contract/queryContractPage', method: 'get' }),
    // 获取合同详情
    getContractDetail: (params) => commonPromise({ params, url: `contract/getContractDetail/${params.contractId}`, method: 'get' }),
    // 新增合同
    addContract: (data) => commonPromise({ data, url: 'contract/addContract', method: 'post' }),
    // 修改合同
    editContract: (data) => commonPromise({ data, url: 'contract/updateContract', method: 'post' }),
    // 上传文件
    fileUpload: (id, data) => commonPromise({ data, url: 'file/bipFileUpload?businessId=' + id, method: 'post', contentType: 'application/x-www-form-urlencoded' }),
    // 根据合同id获取合同结算登记记录列表
    getSettleRecord: (params) => commonPromise({ params, url: `contract/settleRecord/queryByContractId/${params.contractId}`, method: 'get' }),
    // 新增结算登记记录(列表)
    addSettleRecordList: (data) => commonPromise({ data, url: 'contract/settleRecord/addSettleRecordList', method: 'post' }),
    // 查询客户列表(分页)
    getCustomerPage: (params) => commonPromise({ params, url: 'customer/queryCustomerPage', method: 'get' }),
    // 查询收费标准列表(分页)
    getChargeStdPage: (params) => commonPromise({ params, url: 'chargeStd/info/queryChargeStdPage', method: 'get' }),
    // 根据合同id查询附件列表
    getContractFileList: (params) => commonPromise({ params, url: `contract/file/queryContractFileList/${params.contractId}`, method: 'get' }),
    // 合同确认完成
    finishContract: (data) => commonPromise({ data, url: 'contract/finishContract', method: 'post' }),



    // 收样单
    // 收样列表
    getSampleOrderPage: (params) => commonPromise({ params, url: 'sampleOrder/querySampleOrderPage', method: 'get' }),
    // 添加收样单
    addSampleOrder: (data) => commonPromise({ data, url: 'sampleOrder/addSampleOrder', method: 'post' }),
    // 修改收样单
    updateSampleOrder: (data) => commonPromise({ data, url: 'sampleOrder/updateSampleOrder', method: 'post' }),

    // 新增收样单查重接口(报告编号)
    isReportNumberDuplicate:(params)=>commonPromise({ params, url: `sampleOrder/isReportNumberDuplicate/${params.reportNumber}`, method: 'get' }),
    // 新增收样单查重接口(委托编号)
    isEntrustNumberDuplicate:(params)=>commonPromise({ params, url: `sampleOrder/isEntrustNumberDuplicate/${params.entrustNumber}`, method: 'get' }),

    // 获取收样单详情
    getSampleOrder: (params) => commonPromise({ params, url: `sampleOrder/getSampleOrder/${params.sampleId}`, method: 'get' }),
    // 根据合同id查询合同收费标准列表
    getChargeStdList: (params) => commonPromise({ params, url: `contract/chargeDetail/queryChargeStdList/${params.contractId}`, method: 'get' }),    
    // 根据合同id和收费标准id查询合同检测项目列表
    getChargeStdItemList: (params) => commonPromise({ params, url: `contract/chargeDetail/queryChargeStdItemList`, method: 'get' }),
    
    // 添加检测报告登记(检测报告上传)
    addReportRegistration: (data) => commonPromise({ data, url: 'sampleOrder/report/saveReportSubmit', method: 'post' }),
    // 获取检测报告提交记录
    getReportSubmit:(params) => commonPromise({ params, url: `sampleOrder/report/getReportSubmit/${params.sampleId}`, method: 'get' }), 
    
    // 添加检测报告发送登记
    addReportSend: (data) => commonPromise({ data, url: 'sampleOrder/report/saveReportSend', method: 'post' }),
    // 获取检测报告发送记录
    getReportSend:(params) => commonPromise({ params, url: `sampleOrder/report/getReportSend/${params.sampleId}`, method: 'get' }), 


    // 添加结算单登记
    addSettle: (data) => commonPromise({ data, url: 'sampleOrder/settle/addSettle', method: 'post' }),
    // 根据收样单id查询工时登记表
    getTimesheetBySampleId: (params) => commonPromise({ params, url: `/sampleOrder/timesheet/getTimesheetBySampleId/${params.sampleId}`, method: 'get' }),
    // 保存工时表
    saveTimesheet: (data) => commonPromise({ data, url: 'sampleOrder/timesheet/saveTimesheet', method: 'post' }),


    // 查询收样单项目汇总列表(分页)
    getSampleOrderItemCountPage: (params) => commonPromise({ params, url: 'sampleOrder/itemCount/querySampleOrderItemCountPage', method: 'get' }),
    // 收样单批量办理结算
    settleSampleOrderBatch: (data) => commonPromise({ data, url: 'sampleOrder/itemCount/settleSampleOrderBatch', method: 'post' }),
    // 收样单结算完成
    settleCompleteSampleOrder: (data) => commonPromise({ data, url: `sampleOrder/settleCompleteSampleOrder/${data.sampleId}`, method: 'post' }),
    // 作废收样单
    discardSampleOrder: (data) => commonPromise({ data, url: `sampleOrder/discardSampleOrder/${data.sampleId}`, method: 'post' }),

    // 下载检测报告模版
    downloadTemplate: (params) => commonPromise({ params, url: 'sampleOrder/report/downloadTemplate', method: 'get', responseType: 'blob' }),

    // 导出excel表：生成结算单接口
    generateSettleOrder: (data) => commonPromise({ data, url: 'sampleOrder/settle/generateSettleOrder', method: 'post',responseType: 'blob' }),

    


}
